{% from "../../macros/attributes.njk" import govukAttributes -%}

{% if params.html or params.text %}
{% set labelHtml %}
<label class="govuk-label {%- if params.classes %} {{ params.classes }}{% endif %}"
  {{- govukAttributes(params.attributes) -}}
  {%- if params.for %} for="{{ params.for }}"{% endif %}>
  {{ params.html | safe | trim | indent(2) if params.html else params.text }}
</label>
{% endset -%}

{% if params.isPageHeading %}
<h1 class="govuk-label-wrapper">
  {{ labelHtml | safe | trim | indent(2) }}
</h1>
{% else %}
{{ labelHtml | safe | trim }}
{% endif %}
{% endif %}
